

package jetbrains.buildServer.server.rest.util;

import jetbrains.buildServer.server.rest.jersey.provider.annotated.JerseyInjectable;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

/**
 * A way to create REST API classes via Spring beans -aware factory.
 * BeanFactory support assignable constructor parameters
 * @deprecated deprecated for removal because unused.
 * @author Yegor.Yarko
 * Date: 09.08.2010
 */
@Deprecated
@JerseyInjectable
@Component
public class BeanFactory {
  private final ApplicationContext ctx;

  public BeanFactory(ApplicationContext ctx) {
    this.ctx = ctx;
  }

  public <T> T autowire(T t){
    ctx.getAutowireCapableBeanFactory().autowireBean(t);
    return t;
  }

}